package com.sealer.pattern.behavioral.interpreter;

/**
 * Created by sealer on 17/04/10.
 */
public class Plus implements Expression {
    private Expression leftOper;
    private Expression rightOper;

    public Plus(Expression leftOper, Expression rightOper) {
        this.leftOper = leftOper;
        this.rightOper = rightOper;
    }

    @Override
    public int interpret(Context context) {
        return leftOper.interpret(context) + rightOper.interpret(context);
    }
}
